const webpack = require('webpack');
module.exports = {
  entry: {
    'regexper.min.js': ['babel-polyfill', './src/es/regexper/index.js'],
  },
  output: {
    path: __dirname + '/public/js',
    filename: '[name]'
  },
  // devtool: '#eval-source-map',
  devtool: 'none',
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
        warnings: false
      }
    })
  ],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      },
      {
        test: /\.peg$/,
        loader: require.resolve('./lib/canopy-loader')
      },
      {
        test: require.resolve('snapsvg'),
        loader: 'imports-loader?this=>window,fix=>module.exports=0'
      }]
  }
};